
<template>
  <div>
    <el-carousel indicator-position="outside" height="57vh">
      <el-carousel-item v-for="item in url" :key="item">
        <el-image
            style="width: 100%; height: 100%"
            :src="item"
            fit="scale-down"></el-image>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
import {filepath} from "@/configUse";

export default {
  name: "VueImage",
  data() {
    return {
      url:[]
    }
  },
  props:{
  },
  methods:{
    obtainUrl(url){
      if(url!==null){
        let fileV=url.split("|*|")
        fileV.pop();
        for (let i = 0; i < fileV.length; i++) {
          fileV[i]=filepath+fileV[i]
        }
        this.url=fileV
      }
    },
  },
  mounted() {
    this.$bus.$on('obtainUrl',this.obtainUrl)
  },
  beforeDestroy() {
    this.$bus.$off('obtainUrl')
  }
}
</script>


<style scoped>

.el-carousel__item h3 {
  color: #475669;
  font-size: 18px;
  opacity: 0.85;
  line-height: 500px;
  height: 500px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
  background-color: #d3dce6;
}

</style>